<template>
	<CompACF />
</template>

<script>
	
	import { defineComponent } from 'vue';
	
	export default defineComponent({
		name: 'ACFunIndex'
	})
	
</script>

<script setup>
	
	import { ref, reactive, computed, watch, unref, onBeforeMount, onMounted, onUnmounted } from 'vue';
	import { useRoute, useRouter } from 'vue-router';
	import useAppUI from '@/store/appUI';
	import CompACF from './ACF';
	
	const route = useRoute();
	const router = useRouter();
	
	const appUIStore = useAppUI();
	
	onBeforeMount(() => {
		appUIStore.hideHeader(true);
		appUIStore.lockHeader();
		document.addEventListener('keyup', listenEscBack);
	})
	
	onUnmounted(() => {
		appUIStore.freeHeader();
		appUIStore.showHeader();
		document.removeEventListener('keyup', listenEscBack);
	})
	
	function listenEscBack(e) {
		e.preventDefault();
		e.code.toLocaleLowerCase() === 'escape' && router.back();
	}
	
</script>